home *** CD-ROM | disk | FTP | other *** search
- /* HP11C (FF274) to TeX V1.0 */
- /* © by Stefan Haubenthal 1995/96 */
- call open source,arg(1)
- call seek source,-1,E
- len=c2d(readch(source))
- call seek source,x2d("ea"),B
- say "%"sourceline(1)
- say "% "arg(1)
- say "\nopagenumbers"
- cmd.000="$\sqrt x$" /* square root */
- cmd.001="$e^x$"
- cmd.002="$10^x$"
- cmd.003="$y^x$" /* power of */
- cmd.004="$1/x$"
- cmd.005="CHS" /* change sign */
- cmd.006="$\div$"
- cmd.007="SIN"
- cmd.008="COS"
- cmd.009="TAN"
- cmd.00A="EEX" /* exponent */
- cmd.00B="$\times$"
- cmd.00C="R/S" /* run/stop */
- cmd.00D="R$\downarrow$" /* roll down */
- cmd.00E="$x\leftrightarrow y$" /* x versus y */
- cmd.00F="ENTER" /* enter */
- cmd.010="$-$" /* minus */
- cmd.011="." /* point */
- cmd.012="$\Sigma$+" /* add (x,y) */
- cmd.013="+" /* plus */
- cmd.014="$\pi$"
- cmd.015="$x\le y$"
- cmd.016="$x\leftrightarrow (i)$" /* x versus (i) */
- cmd.017="$\to$R"
- cmd.018="$x\leftrightarrow$ I" /* x versus I */
- cmd.019="DSE" /* decrement and skip if equal */
- cmd.01A="ISG" /* increment and skip if greater */
- cmd.01B="$x>y$"
- cmd.01C="PSE" /* pause */
- cmd.01D="CLEAR-$\Sigma$" /* clear statistics */
- cmd.01E="CLEAR-REG" /* clear registers */
- cmd.01F="RAN\#" /* random number */
- cmd.020="P$y,x$"
- cmd.021="$\to$H.MS" /* hours minutes seconds */
- cmd.022="$\to$RAD"
- cmd.023="$x\ne y$" /* x not equal y */
- cmd.025="$x!$" /* factorial */
- cmd.024="FRAC" /* fractional */
- cmd.026="$\hat y,r$" /* estimation, correlation */
- cmd.027="L.R." /* linear regression */
- cmd.028="$x=y$" /* x equal y */
- cmd.029="$x^2$" /* square */
- cmd.02A="LN" /* logarithmus naturalis */
- cmd.02B="LOG" /* logarithmus */
- cmd.02C="\%" /* per cent */
- cmd.02D="$\Delta$\%" /* per cent change */
- cmd.02E="ABS" /* absolute */
- cmd.02F="DEG" /* degree */
- cmd.030="RAD" /* radian */
- cmd.031="GRD" /* grad */
- cmd.032="$x<0$" /* x lower than zero */
- cmd.033="SIN$^{-1}$"
- cmd.034="COS$^{-1}$"
- cmd.035="TAN$^{-1}$"
- cmd.036="$\to$P"
- cmd.037="$x>0$" /* greater then zero */
- cmd.038="RTN" /* return */
- cmd.039="R$\uparrow$" /* roll up */
- cmd.03A="RND" /* round */
- cmd.03B="CLX" /* clear x */
- cmd.03C="LST X" /* last x */
- cmd.03D="C$y,x$"
- cmd.03E="$\to$H"
- cmd.03F="$\to$DEG"
- cmd.040="$x\ne0$" /* x not equal zero */
- cmd.041="INT" /* integer */
- cmd.042="$\bar x$" /* mean */
- cmd.043="$s$" /* sdev */
- cmd.044="$\Sigma-$" /* sub (x,y) */
- cmd.045="$x=0$" /* x equal zero */
- cmd.046="RCL ENTER" /* recall enter */
- cmd.047="RCL $\Sigma$+"
- cmd.048="HYP SIN"
- cmd.049="HYP COS"
- cmd.04A="HYP TAN"
- cmd.04B="HYP$^{-1}$ SIN"
- cmd.04C="HYP$^{-1}$ COS"
- cmd.04D="HYP$^{-1}$ TAN"
- cmd.04E="SF 0" /* set flag 0 */
- cmd.04F="SF 1" /* set flag 1 */
- cmd.050="CF 0" /* clear flag 0 */
- cmd.051="CF 1" /* clear flag 1 */
- cmd.052="F? 0" /* test flag 0 */
- cmd.053="F? 1" /* test flag 1 */
- do i=1 to len
- step=right(c2x(readch(source,2)),3)
- if i//5=0 then call writech stdout,"\item{"i":}{"
- else call writech stdout,"\par{"
- select
- when step<=053 then say value("cmd."step)"}"
- when step>=054 & step<=05D then say "\it"x2d(step)-84"}" /* digit */
- when step>=05E & step<=067 then say "FIX" x2d(step)-94"}" /* fixed */
- when step>=068 & step<=06F then say "SCI" x2d(step)-104"}" /* scientific */
- when step>=070 & step<=077 then say "ENG" x2d(step)-112"}" /* engineering */
- when step>=078 & step<=081 then say "LBL" d2c(x2d(step)-72)"}" /* label digit */
- when step>=082 & step<=086 then say "LBL" d2c(x2d(step)-65)"}" /* label letter */
- when step>=087 & step<=090 then say "GTO" d2c(x2d(step)-87)"}" /* goto digit */
- when step>=091 & step<=095 then say "GTO" d2c(x2d(step)-80)"}" /* goto letter */
- when step=096 then say "GTO I}"
- when step>=097 & step<=0A0 then say "GSB" d2c(x2d(step)-103)"}" /* gosub digit */
- when step>=0A1 & step<=0A5 then say "GSB" d2c(x2d(step)-96)"}" /* gosub letter */
- when step=0A6 then say "GSB I}"
- when step>=0A7 & step<=0B0 then say "STO" d2c(x2d(step)-119)"}" /* store digit */
- when step>=0B1 & step<=0BA then say "STO ." d2c(x2d(step)-129)"}" /* store point digit */
- when step=0BB then say "STO I}" /* store I */
- when step=0BC then say "STO $(i)$}" /* store (i) */
- when step>=0BD & step<=0C6 then say "STO +" d2c(x2d(step)-141)"}" /* store plus digit */
- when step>=0C7 & step<=0D0 then say "STO + ." d2c(x2d(step)-151)"}" /* store plus point digit */
- when step=0D1 then say "STO + I}" /* store plus I */
- when step=0D2 then say "STO + $(i)$}" /* store plus (i) */
- when step>=0D3 & step<=0DC then say "STO -" d2c(x2d(step)-163)"}" /* store minus digit */
- when step>=0DD & step<=0E6 then say "STO - ." d2c(x2d(step)-173)"}" /* store minus point digit */
- when step=0E7 then say "STO - I}" /* store minus I */
- when step=0E8 then say "STO - $(i)$}" /* store minus (i) */
- when step>=0E9 & step<=0F2 then say "STO $\times$" d2c(x2d(step)-185)"}" /* store mult digit */
- when step>=0F3 & step<=0FC then say "STO $\times$ ." d2c(x2d(step)-195)"}" /* store mult point digit */
- when step=0FD then say "STO $\times$ I}" /* store mult I */
- when step=0FE then say "STO $\times$ $(i)$}" /* store mult (i) */
- when step>=0FF & step<=108 then say "STO $\div$" d2c(x2d(step)-207)"}" /* store div digit */
- when step>=109 & step<=112 then say "STO $\div$ ." d2c(x2d(step)-217)"}" /* store div point digit */
- when step=113 then say "STO $\div$ I}" /* store div I */
- when step=114 then say "STO $\div$ $(i)$}" /* store div (i) */
- when step>=115 & step<=11E then say "RCL" d2c(x2d(step)-229)"}" /* recall digit */
- when step>=11F & step<=128 then say "RCL ." d2c(x2d(step)-239)"}" /* recall point digit */
- when step=129 then say "RCL I}" /* recall I */
- when step=12A then say "RCL $(i)$}" /* recall (i) */
- otherwise say step"?}"
- end
- end
- say "\bye"
- /*
- Modes:
- P/R program/run
- USER user
- ON power on
- MEM memory
- CLEAR-PREFIX clear prefix
-
- Edit:
- <- delete
- SST single step
- BST back step
- GTO.xxx goto step xxx
- CLEAR-PRGM clear program
- */
-